/**
* @description : 零售户、无证户走访
* @descriptionDetail : 零售户、无证户走访
* @copyright : 浙江烟草
* @author : mc
* @create : 2022-12-05 15:02:05
*/
<template>
	<view>
		<view class="retail">
			<fsection :title="title.basemsg" class="pl-16"></fsection>
			<u-gap :height="$theme.cm_section_top_gap_height" :bg-color="$theme.cm_gap_color"></u-gap>
		</view>
		<view class="ordermsg">
			<mescroll-list :i="0" :index="0" :height="getListViewHeight()" :load-data="myLoadData" :init-load="false" ref="mescrollItem" class="listview">
				<template slot-scope="d">
					<item-visit-info :relInfo="d.data"></item-visit-info>
				</template>
			</mescroll-list>
		</view>
	</view>
</template>

<script>
	import fsection from "@/components/form-section";
	import mescrollList from '@/components/mescroll_list.vue';
	import itemVisitInfo from "./common/itemVisitInfo.vue";
	import checkService from "@/service/check/check.service";
	export default {
		components: {
			fsection,
			mescrollList,
			itemVisitInfo,
		},
		props: ['retailerUuid', ],
		data() {
			return {
				title: {
					basemsg: "走访信息",
				},
			}
		},
		mounted() {},
		methods: {
			getListViewHeight() {
				let p = (this.$u.sys().windowHeight - 44 - uni.upx2px(104) - uni.upx2px(120) - 8 - this.$u.sys().statusBarHeight) + "px";
				// #ifdef H5-DINGDING
				p = (this.$u.sys().windowHeight - uni.upx2px(104) - uni.upx2px(120) - 8 - this.$u.sys().statusBarHeight) + "px";
				// #endif
				return p;
			},
			myLoadData(page) {
				return new Promise((resolve) => {
					checkService.getVisitRecord(page.num, page.size, {
						retailerUuid: this.retailerUuid
					}).then(res => {
						if (res.success) {
							resolve({
								totalCount: res.count,
								data: [...res.data, ],
							});
						} else {
							resolve({
								totalCount: 0,
								data: [],
							})
						}
					}).catch(e => {
						resolve({
							totalCount: 0,
							data: [],
						})
					})
				});
			},
		},

	}
</script>

<style lang="scss" scoped>
	@import "../unlicense_item.scss";

	.head-title {
		padding: 0rpx 12rpx 0rpx 12rpx;
		font-size: $cm_form_item_label_font_size;
		font-weight: bold;
	}

	.left-icon {
		margin: 0rpx 10rpx;
		width: 9rpx;
		height: 32rpx;
		background: $u-type-primary;
		opacity: 1;
		border-radius: 5px;
		display: inline-block;
	}

	.case-info {
		font-size: $cm_form_item_label_font_size;
	}

	.case-content {
		padding: 5px 0px;
	}

	.ordermsg {
		position: relative;
		padding: 0rpx 28rpx 10rpx 28rpx;
		margin: 10rpx 0rpx;
		background-color: #fff;
	}

	.ipt {
		position: absolute;
		display: flex;
		float: right;
		display: flex;
		float: right;
		left: 201px;
		top: -48px;
		text-align: center;
	}
</style>